﻿using Sys.Core.Tour;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class HotelList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ListInit();

            Home mas = Master as Home;

            mas.SetHead("酒店住宿", "酒店住宿", "酒店住宿");
        }
    }

    public void ListInit()
    {
        var list = HotelBll.I.Entities.OrderByDescending(m => m.UpdateTime);

        int recordcount = list.Count();
        int page = Convert.ToInt32(Request.QueryString["page"]);
        int rows = 12;
        if (page == 0) { page = 1; }

        rep_List.DataSource = HotelBll.I.EntitiesPage(list, rows, page).ToList();
        rep_List.DataBind();

        Pager.UpdatePage(recordcount, rows, page, Request.Url.LocalPath, string.Empty);
    }

    public string GetFront(string id)
    {
        return ImageBll.I.GetFront("Hotel", id);
    }
}